package com.kgc.bigdata.spark.scala

class AbstractDemo {
}

abstract class Person2 {
  //属性和方法不需要添加abstract关键字
  def speak

  val name: String
  var age: Int
}


class Student2 extends Person2 {
  def speak() {
    //返回值为Unit
    println("speak~~~")
  }

  val name = "zhangsan"
  var age = 100
}

object AbstractDemo extends App {
  val s = new Student2
  s.speak
  println("name is:" + s.name + " , age is: " + s.age)
}

